﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XiaLastorm.Sharpshooter
{
	/// <summary>
	/// 请求登录消息，由客户端发送给服务器
	/// </summary>
	[Serializable]
	public class LogInMessage : Message
	{
		/// <summary>
		/// 用户名
		/// </summary>
		public string Username { get; set; }
		/// <summary>
		/// 密码
		/// </summary>
		public string Password { get; set; }

		/// <summary>
		/// 生成 <see cref="LogInMessage"/> class 的新实例。
		/// </summary>
		/// <param name="username">用户名</param>
		/// <param name="password">密码</param>
		public LogInMessage(string username, string password)
		{
			User.ValidateUsername(username);
			Username = username;
			Password = password;
		}

		public override string ToString()
		{
			return string.Format("Username: {0} Password: {1}", Username, Password);
		}
	}
}
